package com.yuntuzhilian.chapter4;

/**
 * @author MrWang-shuizhishuiheshui
 * @description
 */
public class Demo7 implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName()+"****"+i);
            if (i==5){
                Thread.yield();
            }
        }
    }

    public static void main(String[] args) {
        Thread thread=new Thread(new Demo7());
        Thread thread1=new Thread(new Demo7());
        thread.start();
        thread1.start();
    }
}
